Skip to content

Add @Nullable to ScrollView getChildVisibleRect offset parameter#57075

Open
cortinico wants to merge 1 commit into
facebook:mainfrom
cortinico:export-D107507935
Open

Add @Nullable to ScrollView getChildVisibleRect offset parameter#57075
cortinico wants to merge 1 commit into
facebook:mainfrom
cortinico:export-D107507935

Conversation

@cortinico
Copy link
Copy Markdown
Contributor

@cortinico cortinico commented Jun 4, 2026

Summary:
The offset parameter in getChildVisibleRect overrides was missing the
Nullable annotation. The Android framework contract for
ViewGroup.getChildVisibleRect(View, Rect, Point) allows offset to be null,
and View.getGlobalVisibleRect(Rect) legitimately passes null. The Nullsafe
instrumentation injected a non-null assertion that crashed when null was passed.

Changelog:
[Android][Fixed] - Fix NullPointerException in ScrollView getChildVisibleRect when offset is null

Reviewed By: javache

Differential Revision: D107507935

@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jun 4, 2026
@meta-codesync
Copy link
Copy Markdown

meta-codesync Bot commented Jun 4, 2026

@cortinico has exported this pull request. If you are a Meta employee, you can view the originating Diff in D107507935.

@facebook-github-tools facebook-github-tools Bot added p: Facebook Partner: Facebook Partner labels Jun 4, 2026
@meta-codesync meta-codesync Bot changed the title Add @Nullable to ScrollView getChildVisibleRect offset parameter Add @Nullable to ScrollView getChildVisibleRect offset parameter (#57075) Jun 4, 2026
@cortinico cortinico force-pushed the export-D107507935 branch from d984dea to 9376eb4 Compare June 4, 2026 10:20
@meta-codesync meta-codesync Bot changed the title Add @Nullable to ScrollView getChildVisibleRect offset parameter (#57075) Add @Nullable to ScrollView getChildVisibleRect offset parameter Jun 4, 2026
@cortinico cortinico force-pushed the export-D107507935 branch from 9376eb4 to 315acb8 Compare June 4, 2026 11:34
@meta-codesync meta-codesync Bot changed the title Add @Nullable to ScrollView getChildVisibleRect offset parameter Add @Nullable to ScrollView getChildVisibleRect offset parameter (#57075) Jun 4, 2026
cortinico added a commit to cortinico/react-native that referenced this pull request Jun 4, 2026
…ebook#57075)

Summary:

The `offset` parameter in `getChildVisibleRect` overrides was missing the
`Nullable` annotation. The Android framework contract for
`ViewGroup.getChildVisibleRect(View, Rect, Point)` allows `offset` to be null,
and `View.getGlobalVisibleRect(Rect)` legitimately passes null. The `Nullsafe`
instrumentation injected a non-null assertion that crashed when null was passed.

Changelog:
[Android][Fixed] - Fix NullPointerException in ScrollView `getChildVisibleRect` when `offset` is null

Reviewed By: javache

Differential Revision: D107507935
@cortinico cortinico force-pushed the export-D107507935 branch from 315acb8 to ba43ae9 Compare June 4, 2026 11:37
Summary:
The `offset` parameter in `getChildVisibleRect` overrides was missing the
`Nullable` annotation. The Android framework contract for
`ViewGroup.getChildVisibleRect(View, Rect, Point)` allows `offset` to be null,
and `View.getGlobalVisibleRect(Rect)` legitimately passes null. The `Nullsafe`
instrumentation injected a non-null assertion that crashed when null was passed.

Changelog:
[Android][Fixed] - Fix NullPointerException in ScrollView `getChildVisibleRect` when `offset` is null

Reviewed By: javache

Differential Revision: D107507935
@meta-codesync meta-codesync Bot changed the title Add @Nullable to ScrollView getChildVisibleRect offset parameter (#57075) Add @Nullable to ScrollView getChildVisibleRect offset parameter Jun 4, 2026
@cortinico cortinico force-pushed the export-D107507935 branch from ba43ae9 to f70abcd Compare June 4, 2026 12:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. fb-exported meta-exported p: Facebook Partner: Facebook Partner

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant